#include "comm.hpp"

int main()
{
    int shmid = GetShm();
    char *shmaddr = (char*)shmat(shmid,nullptr,0);

    int fd = open(FIFO_FILE,O_WRONLY);
    if(fd < 0)
    {
        log(Fatal,"error string: %s,error code: %d",strerror(errno),errno);
        exit(FIFO_OPEN_ERR);
    }

    while(true)
    {
        cout << "Please Enter@ ";
        fgets(shmaddr,4096,stdin);

        write(fd,"c",1);
    }

    shmdt(shmaddr);

    close(fd);
    return 0;
}